<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>div浮动</title>
    <style type="text/css">
        #div01{
            width: 200px;
            height: 200px;
            background-color: #CCCCCC;
            float: left;       /* 修改div的默认效果   1个div1行，多个div一行    脱离文档流*/

        }
        #div02{
            width: 200px;
            height: 200px;
            background-color:red;
            float:left;

        }
        #div03{
            width: 200px;
            height: 400px;
            background-color:blanchedalmond;
        }
        #div04{
            width: 0px;
            height: 0px;
            clear: both;   /*取消浮动*/

        }


    </style>
</head>
<body>
<div id="div01">

</div>
<div id="div02">

</div>
<div id="div04">

</div>

<div id="div03">

</div>

</body>
</html>